/*
 * @Description: 流转按钮
 * @Author: Zzt
 * @Date: 2022-09-28 14:57:08
 * @LastEditTime: 2023-01-16 17:22:19
 */

import { useEffect, useMemo, useState } from 'react';
import { Button, Popover, Space } from 'antd';
import TransferFileModal from '../dialogs/TransferFile';
interface ICirculationProps {
  selectItems: number[];
  baseInfo: any;
}
const Circulation = (props: ICirculationProps) => {
  const { selectItems, baseInfo } = props;
  console.log('baseInfo', baseInfo, selectItems);

  const [transferVisible, setTransferVisible] = useState(false);

  const TransferFile = () => {
    setTransferVisible(true);
  };

  return (
    <>
      <Button disabled={selectItems.length === 0} onClick={() => TransferFile()}>
        转档案
      </Button>

      {useMemo(
        () => (
          <TransferFileModal
            visible={transferVisible}
            onClose={() => setTransferVisible(false)}
            selectItems={selectItems}
            baseInfo={baseInfo}
          />
        ),
        [transferVisible]
      )}
    </>
  );
};
export default Circulation;
